// 引入 express 
var express = require('express');
// 引入 路由
var myRouter = express.Router();
//引入db
var db=require('../utils/db');

myRouter.route('/getorder').get (function(request,response){
var sql="SELECT * FROM `order` JOIN olderly_infor ON `order`.order_id=olderly_infor.olderly_id JOIN service_type ON service_type.service_id=olderly_infor.olderly_id JOIN escortPeople ON escortPeople.id=service_type.service_id JOIN evaluation ON evaluation.eva_id= escortPeople.id; ";
db.query(sql,function(err,data){
    if(!err){
        response.json({
            err:0,
            msg:'查询成功',
            data:data})
    }else{
        response.json({err:1,msg:'查询失败'})
    }
})
})

module.exports=myRouter;